package com.icode.chat;

/**
 * Created with IntelliJ IDEA.
 * User: ZhongGang
 * Date: 14-8-2
 * Time: 上午1:16
 */
public class ChatRoomsSingleton {
    private static ChatRooms chatRooms = new ChatRooms();

    static {
        chatRooms.put("NEWS", new ChatRoom());
        chatRooms.put("SPORTS", new ChatRoom());
        chatRooms.put("ENTERTAINMENT", new ChatRoom());
        chatRooms.put("FINANCE", new ChatRoom());
        chatRooms.put("STOCK", new ChatRoom());
        chatRooms.put("CAR", new ChatRoom());
        chatRooms.put("TECHNOLOGY", new ChatRoom());
        chatRooms.put("PHONE", new ChatRoom());
        chatRooms.put("DIGITAL", new ChatRoom());
        chatRooms.put("HOUSE", new ChatRoom());
        chatRooms.put("FURNITURE", new ChatRoom());
        chatRooms.put("EDUCATION", new ChatRoom());
        chatRooms.put("BOOK", new ChatRoom());
        chatRooms.put("GAME", new ChatRoom());
        chatRooms.put("LOTTERY", new ChatRoom());
    }

    public static ChatRooms singleton() {
        if (chatRooms == null) {
            throw new IllegalStateException("chat rooms should not be null, must be initialized after web start");
        }
        return chatRooms;
    }
}
